from threading import Thread
import time
# 使用全局变量通信
# 线程中的通信比进程通信方便的多，各个线程共享全局变量
param_s = []
def func():

    for i in range(5):
        print(param_s)
        param_s.append(i)
        time.sleep(1)

if __name__ == '__main__':
    thread1 = Thread(target=func)
    thread2 = Thread(target=func)
    thread1.start()
    thread2.start()
